#include<iostream>
#include<cstdio>
using namespace std;
int h[100],a[100];
int n,m,q;
int find(int x){
	if(h[x]==x)return x;
	else return find(h[x]);
}
void merge(int x,int y){
	int xf=find(x),yf=find(y);
	if(xf!=yf){
		h[xf]=h[yf];
	}
	return ;
}
int main(){
	cin>>n>>m>>q;
	for(int i=1;i<=n;i++)h[i]=i;
	for(int i=1;i<=m;i++){
		int x,y;
		cin>>x>>y;
		merge(x,y);
	}
	for(int i=1;i<=q;i++){
		int x,y;
		cin>>x>>y;
		if(find(x)==find(y)){
			cout<<"Yes\n";
		}else{
			cout<<"No\n";
		}
	}
} 
